<template>
    <view class="box">

        <!-- main -->
        <view class="main">
            <view class="add-carplate" @click=" goToUrl('/pages/user/addcar')">
                <view class="left">
                    <u-icon name="plus"></u-icon>
                    <text>关联车队</text>
                </view>
                <view>
                    <u-icon name="arrow-right"></u-icon>
                </view>
            </view>
            <view>
                <u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
                </u-empty>
            </view>
        </view>
        <u-datetime-picker :show="show" v-model="birthday" mode="date" @cancel="show = false"
            @confirm="confirmDate"></u-datetime-picker>

    </view>
</template>
<script>
export default {
    data() {
        return {
            fileList: [],
            telNum: "",
            show: false,
            date_: "",
            birthday: Number(new Date()),
        }
    },
    methods: {
        afterRead(event) {
            console.log(event)
            this.fileList[0] = event.file.url
        },
        checkTelephone(telephone) {
            var reg = /^[1][3,4,5,7,8][0-9]{9}$/;
            if (!reg.test(telephone)) {
                return false;
            } else {
                return true;
            }
        },
        confirmDate(e) {
            const date = new Date(e.value)
            const year = date.getFullYear()
            const month = date.getMonth() + 1
            const day = date.getDate()
            this.date_ = year + '-' + month + '-' + day
            this.show = false
        }
    }
}
</script>
<style lang="scss" scoped>
.box {
    background-color: #eee;
    height: 100vh;
}

.add-carplate {
    @include flex-center(row, space-between, center);
    padding: 20rpx;
    background-color: #fff;
    border-radius: 10rpx;
    margin-top: 20rpx;

    .left {
        @include flex-center(row, flex-start, center);

        text {
            margin-left: 10rpx;
            font-size: 24rpx;

        }
    }
}

.main {
    padding: 0 40rpx;

    .item {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-bottom: 40rpx;
        padding: 10rpx 0;

        ::v-deep .u-text {
            flex: 1.5;
        }

        ::v-deep .u-input {
            flex: 3;
        }
    }
}
</style>
